<div class="callout callout-info">
    <h4>{:__('Alert')}!</h4>
    {:__('To add fields, please bind the form model first, the generated fields please fill in the parameters accurately')}
</div>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <input type="hidden" name="row[oldFieldName]" value="{$row.name}">
    <input type="hidden" name="row[oldFieldTable]" value="{$row.form_id}">
    <div class="form-group">
        <label for="c-formList" class="control-label col-xs-12 col-sm-2">{:__('Form Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-formList" data-rule="required" class="form-control selectpicker" name="row[form_id]">
                {foreach name="formList" item="vo"}
                <option value="{$vo.id}" {if condition="$vo.id == $row.form_id"} selected {/if}>{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-formTitle" class="control-label col-xs-12 col-sm-2">{:__('Field Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" id="c-formTitle" name="row[title]" class="form-control" value="{$row.title}" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-formName" class="control-label col-xs-12 col-sm-2">{:__('Field Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" id="c-formName" name="row[name]" class="form-control" value="{$row.name}" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-formType" class="control-label col-xs-12 col-sm-2">{:__('Field Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-formType" name="row[type]" data-rule="required" class="form-control">

                <option value="int" {if condition="$row.type == 'int'"} selected {/if}>int</option>
                <option value="tinyint" {if condition="$row.type == 'tinyint'"}selected {/if}>tinyint</option>
                <option value="varchar" {if condition="$row.type == 'varchar'"}selected {/if}>varchar</option>
                <option value="char" {if condition="$row.type == 'char'"}selected {/if}>char</option>
                <option value="text" {if condition="$row.type == 'text'"}selected {/if}>text</option>
                <option value="date" {if condition="$row.type == 'date'"}selected {/if}>date</option>
                <option value="datetime" {if condition="$row.type == 'datetime'"}selected {/if}>datetime</option>
                <option value="timestamp" {if condition="$row.type == 'timestamp'"}selected {/if}>timestamp</option>
                <option value="time" {if condition="$row.type == 'time'"}selected {/if}>time</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-formShowType" class="control-label col-xs-12 col-sm-2">{:__('Field Show Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-formShowType" name="row[show_type]" data-rule="required" class="form-control">
                <option value="1" {if condition="$row.show_type == 1"}selected {/if}>文本框</option>
                <option value="2" {if condition="$row.show_type == 2"}selected {/if}>多行文本</option>
                <option value="3" {if condition="$row.show_type == 3"}selected {/if}>编辑器</option>
                <option value="4" {if condition="$row.show_type == 4"}selected {/if}>文件上传</option>
                <option value="10" {if condition="$row.show_type == 10"}selected {/if}">单图片上传</option>
                <option value="5" {if condition="$row.show_type == 5"}selected {/if}>组图上传</option>
                <option value="6" {if condition="$row.show_type == 6"}selected {/if}>下拉菜单</option>
                <option value="7" {if condition="$row.show_type == 7"}selected {/if}>日期和时间</option>
                <option value="8" {if condition="$row.show_type == 8"}selected {/if}>单选</option>
                <option value="9" {if condition="$row.show_type == 9"}selected {/if}>多选</option>
            </select>
            <p class="help-block">{:__('We support the control: a single line of text, multiple lines of text, drop-down box, radio buttons, check boxes')}</p>
        </div>
    </div>

    <div class="form-group">
        <label for="c-formLength" class="control-label col-xs-12 col-sm-2">{:__('Field Length')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" id="c-formLength" name="row[length]" class="form-control" value="{$row.length}" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-formDecimal" class="control-label col-xs-12 col-sm-2">{:__('Field Decimal')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" id="c-formDecimal" name="row[decimal]" class="form-control" value="{$row.decimal}" />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Field Required')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[required]', ['1'=>__('Yes'), '0'=>__('No')], $row['required'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-formNotes" class="control-label col-xs-12 col-sm-2">{:__('Field Notes')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" id="c-formNotes" name="row[notes]" class="form-control" value="{$row.notes}" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-formDefault" class="control-label col-xs-12 col-sm-2">{:__('Field Default')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" id="c-formDefault" name="row[default]" class="form-control" value="{$row.default}" />
            <p class="help-block">{:__('No use (judgment of different field types)')}</p>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Backend Display')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[backend_show]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['backend_show'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-setting" class="control-label col-xs-12 col-sm-2">{:__('Field Setting')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-setting" class="form-control" name="row[setting]">{$row.setting}</textarea>
            <p class="help-block">{:__('Dropdown frame format: man--男||woman--女||default--保密')}</p>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
